home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / PDraw3.0.adf / pdraw_rex.lzh / PDrawGenie.hlp < prev    next >
Text File  |  1992-06-15  |  1KB  |  61 lines

  1. /*
  2. @BPDrawGenie.hlp@P
  3. Copyright Gold Disk Inc., February, 1992
  4. This genie reads the comment field in other genies and informs the user of the genies uses
  5. */
  6. parse arg genie
  7. if ~show(l, "rexxsupport.library") then
  8.    if ~addlib("rexxsupport.library",0,-30) then
  9.       exit_msg("Please install the rexxsupport.library in your libs: directory before running this Genie.!")
  10.  
  11. if ~open(file, genie, "r") then exit_msg("Unable to open: "genie)
  12.  
  13. string = ''
  14. do while ~eof(file)
  15.     line = readln(file)
  16.     if strip(line) = '' then iterate
  17.     if pos("/*", line) ~= 0 then
  18.        do
  19.        parse var line '/*' line
  20.        if strip(line) = '' then iterate
  21.        end
  22.     if pos("*/", line) ~= 0 then
  23.        do
  24.        parse var line line '*/'
  25.        if strip(line) ~= '' then
  26.      do
  27.      string = string||'0a'x||"@L"||line
  28.      end
  29.        leave
  30.        end
  31.     else
  32.        string = string||'0a'x||"@L"||line
  33. end
  34.  
  35. close(file)
  36. if string = '' then exit_msg("No Help Available.")
  37.  
  38. fline = pos('@N', string) + 1
  39. if fline > 1 then
  40. do
  41.    fstate = "@B"genie" @I Copyright © 1992 Gold Disk Inc."
  42.    string = insert(fstate" ", string, fline)
  43. end
  44.  
  45. fline = pos('@I', string) + 1
  46. if fline > 1 then
  47. do
  48.    fstate = '['||word(statef(genie), 2)||']'
  49.    string = insert(fstate" ", string, fline)
  50. end
  51.  
  52. call pdm_Inform(1,substr(string,2),)
  53. exit
  54.  
  55. exit_msg: procedure
  56. do
  57.     arg message
  58.     if message ~= '' then call pdm_Inform(1,message,)
  59.     exit
  60. end
  61.